//
//  LogisticsWebViewController.m
//  B2C
//
//  Created by 李小龙 on 2017/8/29.
//  Copyright © 2017年 lixiaolong. All rights reserved.
//

#import "LogisticsWebViewController.h"

@interface LogisticsWebViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@property (nonatomic, copy) NSString *loadUrl;

@end

@implementation LogisticsWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"查看物流";
    self.loadUrl = [NSString stringWithFormat:@"%@com=%@&nu=%@",BASE_KuaiDi_URL,self.com,self.nu];
    [MBProgressHUD showHUDProgress:self.view animated:YES];
    [self.webView loadRequest:[NSURLRequest requestWithURL:GetUrl(self.loadUrl)]];
}
#pragma mark - webViewDelegate
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
//    [MBProgressHUD showHUDProgress:self.view animated:YES];
    return YES;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
